placessidebar: Fix the bookmark drag icon
authorMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 18:24:45 +0000 (14:24 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sat, 8 Aug 2020 18:24:45 +0000 (14:24 -0400)
Just use the widget; a paintable only works if the
widget it is based on actually gets drawn, the
clone we create here wasn't.

gtk/gtkplacessidebar.c

index f72301e60ff02fc12e70f0b169d4be038d8ffed2..106f2277891b49cde3af72aab0bd1a8bd3179e01 100644 (file)
@@ -61,7 +61,6 @@
 #include "gtknative.h"
 #include "gtkdragsource.h"
 #include "gtkdragicon.h"
-#include "gtkwidgetpaintable.h"
 #include "gtkstylecontext.h"
 
 /*< private >
@@ -3475,7 +3474,6 @@ on_row_dragged (GtkGestureDrag *gesture,
       GdkDevice *device;
       GtkAllocation allocation;
       GtkWidget *drag_widget;
-      GdkPaintable *paintable;
       GdkDrag *drag;
 
       gtk_gesture_drag_get_start_point (gesture, &start_x, &start_y);
@@ -3501,17 +3499,11 @@ on_row_dragged (GtkGestureDrag *gesture,
       gtk_widget_hide (sidebar->drag_row);
 
       drag_widget = GTK_WIDGET (gtk_sidebar_row_clone (GTK_SIDEBAR_ROW (sidebar->drag_row)));
-      g_object_ref_sink (drag_widget);
       sidebar->drag_row_height = allocation.height;
       gtk_widget_set_size_request (drag_widget, allocation.width, allocation.height);
-
       gtk_widget_set_opacity (drag_widget, 0.8);
 
-      paintable = gtk_widget_paintable_new (drag_widget);
-      gtk_drag_icon_set_from_paintable (drag, paintable, sidebar->drag_row_x, sidebar->drag_row_y);
-      g_object_unref (paintable);
-
-      g_object_set_data_full (G_OBJECT (drag), "row-widget", drag_widget, (GDestroyNotify)g_object_unref);
+      gtk_drag_icon_set_child (GTK_DRAG_ICON (gtk_drag_icon_get_for_drag (drag)), drag_widget);
 
       g_object_unref (drag);
     }